Add minimal user-defined functions implementation#413
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Co-authored-by: lightswarm124 <lightswarm@gmail.com> Co-authored-by: Mathieu Geukens <mr-zwets@protonmail.com> - Add top-level user-defined function syntax - Functions can return a single value or nothing - Add import syntax - Imports are resolved and flattened into a single AST before compiler traversals - Used functions are defined at the top of a contract, their function bodies are compiled with a separate GenerateTargetTraversal + optimisations - Update builtin function compilation to self-document their bytecode - Update docs & release notes This version does NOT YET support: - Multiple return values / tuples - Proper SDK debugging integration - Safety checks - Nested / multiple returns in a function - Advanced optimisations - Global constants - Cross-file pragma resolutions
19422ea to
6ab12fb
Compare
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## next #413 +/- ##
==========================================
+ Coverage 85.69% 86.31% +0.61%
==========================================
Files 51 55 +4
Lines 4041 4318 +277
Branches 757 805 +48
==========================================
+ Hits 3463 3727 +264
- Misses 453 465 +12
- Partials 125 126 +1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
…used inside user-functions
This was referenced Jun 26, 2026
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
bodies are compiled with a separate GenerateTargetTraversal + optimisations
This version does NOT YET support: